package com.zjc.stock.strategy;

import com.zjc.stock.StockExchange;
import com.zjc.stock.model.Account;
import com.zjc.stock.model.FeeDetail;

/**
 * 手续费计算
 */
public class Commission {

    public static void main(String[] args) {
        Account account = new Account();
        StockExchange.account = account;

        Double priceS = 7.08;
        Double priceB = 7.07;
        Long count = 2000l;

        FeeDetail feeDetailS = StockExchange.sell(count,priceS);
        feeDetailS.print();
        FeeDetail feeDetailB = StockExchange.buy(count,priceB);
        feeDetailB.print();
        Double many = (priceS - priceB) * count - feeDetailS.getTotalFee() - feeDetailB.getTotalFee();

        System.out.println("盈利：" + many);
    }
}
